 <?php include('session.php');include('MatarSessionInactiva.php'); ?>
<!DOCTYPE html>
<html>
  <head>
    <title>Perfiles - Cursos</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <script type="text/javascript" src="js/bootstrap-tab.js"></script>
    <script type="text/javascript" src="http://twitter.github.com/bootstrap/assets/js/bootstrap-tab.js"></script>
    <script src="js/jPages.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $("div.holder").jPages({
        containerID : "cursos",
        perPage: 5
      });
    });
    </script>
  </head>
  <body>
        <script src="http://code.jquery.com/jquery.js"></script>
        <script src="js/bootstrap.min.js"></script>
        
          <nav class="navbar-wrapper navbar-default navbar-fixed-top" role="navigation">
            <div class="collapse navbar-collapse navbar-ex1-collapse">
              <div class="collapse navbar-collapse">
                <ul class="nav navbar-nav">
                       <li><a href="ViewHome.php"><span class="glyphicon glyphicon-home"></span> Inicio</a></li>

                  <li><a href="ViewCarreras.php"><span class="glyphicon glyphicon-lock"></span> Carreras</a></li>

                  
                  <li class="dropdown"  class="active">
                    <a href="ViewPerfiles.php" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-list-alt"></span> Perfiles</a>
                   <ul class="dropdown-menu" >
                    <li><a href="View_PA.php"><span class="glyphicon glyphicon-bookmark"></span> Perfil Acad&eacute;mico</a></li>
                    <li class="active"><a href="View_C.php"><span class="glyphicon glyphicon-book"></span> Perfil Curso</a></li>
                    <li><a href="#presupuesto" data-toggle="tab"><span class="glyphicon glyphicon-briefcase"></span> Perfil Presupuestarios</a></li> 
                  </ul>
                  </li>

                  <li><a href="ViewUsuarios.php"><span class="glyphicon glyphicon-user"></span> Usuarios</a></li>

                  <li><a href=""><span class="glyphicon glyphicon-calendar"></span> Horarios</a></li>

                  <li><a href=""><span class="glyphicon glyphicon-comment"></span> Reportes</a></li>

                  <ul class="nav navbar-nav navbar-right">
                    <li class="dropdown">
                      <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-asterisk"></span>
                      <ul class="dropdown-menu">
                        <li><a href="cerrarSesion.php">Salir</a></li>
                      </ul>
                    </li>
                  </ul>
            </div>
          </nav>
          <!--
          Se usa la de abajo para meter todo los forms.
          !-->
          <div class="container-fluid">
            <div class="jumbotron">
              
              <center>
                <h3><p class="text-info"><span class="glyphicon glyphicon-folder-open"></span> Lista de Cursos.</p></h3>
              </center>
              <?php
              $codigo_Grado=$_GET['codigogrado'];
               $codigo_Carrera=$_GET['codigocarrera'];
               ?>
              <a align="right"  href="View_C.php?codigocarrera=$codigo_Carrera"><span class="glyphicon glyphicon-plus"></span> Nuevo Curso</a>
               
            <center>  
              <div class="input-group">
                <div class="holder"></div>
   
              <?php 
              include('ModelConexion.php');

              

              echo '<table border=1 class="table table-striped" id="cursos">'; 
              echo "<tr>"; 
              echo "<td><b>Codigo</b></td>"; 
              echo "<td><b>Nombre</b></td>"; 
              echo "<td><b>Horas Contacto</b></td>"; 
              echo "<td><b>Creditos</b></td>"; 
              echo "<td><b>Carrera</b></td>";
              echo "<td><b>Nivel de Carrera</b></td>"; 
              echo "<td><b>Acciones</b></td>"; 
           //   echo "<tbody id='cursos'>"; 
              
              echo "</tr>";   
              //Objetos
              //$usuario->Us_Buscar();
              $conexion = new Conexion();
              $consulta = $conexion->Consulta("
              SELECT pcdatos.codigo AS Cod,
                pcdatos.nombre ,
                pcdatos.horasContacto,
                pcdatos.creditos
                FROM pcdatos,gradosacademicos,carreras
                WHERE pcdatos.codigoGrado=gradosacademicos.codigoGrado
               AND gradosacademicos.codigoCarr = carreras.codigo
               AND gradosacademicos.codigoGrado = '$codigo_Grado'
               ORDER BY horasContacto ASC
              ");

              if($conexion->numero_filas($consulta) > 0)
              { 
                while ($Busca_C = $conexion->Arreglo($consulta))
                {
                  
                  echo "<tr id='cursos'>"; 
                  echo "<td valign='top'>" .( $Busca_C['Cod']) . "</td>"; 
                  echo "<td valign='top'>" .( $Busca_C['nombre']) . "</td>";
                  echo "<td valign='top'>" .( $Busca_C['horasContacto']) . "</td>";
                  echo "<td valign='top'>" .( $Busca_C['creditos']) . "</td>";
                  echo "<td valign='top'><a href=View_C_Modificar.php?codigo=$Busca_C[Cod]><span class='glyphicon glyphicon-edit'> </a>
                  <a href=View_C_Eliminar.php?cedula={$Busca_C['Cod']}> <span aling=right class='glyphicon glyphicon-remove-sign'> </a></td> "; 
                  echo "</tr>"; 
                  //echo "</tbody>";
                }
              }
       
                  echo "</table>";
                  
              ?>

              </tr>
              </table>
              <ul class="pager">
                <li class="previous disabled"><a href="#">&larr; Mas Nuevo</a></li>
                <li class="next"><a href="#">Mas Antiguo &rarr;</a></li>
              </ul>
            </div>

              </center>
            </div>
          </div> 
 

          <?php include("footer.php");?> 
  
  
  </body>
</html>